package com.itheima.charstream;

import java.io.FileReader;
import java.io.IOException;

/*
字符流  读数据
 */
public class Demo05 {


    public static void main(String[] args) throws IOException {
        //创建对象
        //char  没有符号位   0-65535
        FileReader reader = new FileReader("day13\\a.txt");

       char[] chars=new char[1024];//1024个字
        int len;
    /*  while (true){
          len = reader.read(chars);
          if(len==-1){
              break;
          }
          String s = new String(chars, 0, len);
          System.out.println(s);

      }*/
    while ((len=reader.read(chars))!=-1){
        String s = new String(chars, 0, len);
        System.out.println(s);
    }

        //释放资源
        reader.close();
    }

}
